<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <link rel="stylesheet" href="../css/swiper-4.3.5.min.css">
    <link rel="stylesheet" href="../css/element.css">
    <link rel="stylesheet" href="../css/main.css">
    <link rel="stylesheet" href="../css/person_center/person_center.css">
    <title>会员中心-会员</title>
</head>

<body>
    <div id="app" v-cloak>
        <headers></headers>
        <!-- search -->
        <div class="search wrap">
            <logo></logo>
            <div class="header_tit fl"></div>
            <searchs></searchs>

            <car_box></car_box>

        </div>
        <div class="wrap person_center">
            <!-- nav -->
            <div class="nav_box fl">
                <div id="subapp" v-cloak>
                    <div class="person_nav fl">
                        <ul>
                            <li class="active" @click='person_order'>首页</li>
                            <li @click='person_center'>我的订单</li>
                            <li @click='person_address'>收货地址</li>
                            <li @click='person_exchange_page'>积分换货</li>
                            <li @click='person_integral'>积分订单</li>
                            <li @click='person_collection'>我的收藏</li>
                            <li @click='person_foot'>浏览足迹</li>
                            <li @click='person_ticket'>优惠券</li>
                            <li @click='person_info'>个人设置</li>
                            <li @click='person_message'>消息中心</li>
                        </ul>
                    </div>
                </div>
            </div>
            <div class="right_box fl">
                <div class="person_index">
                    <div class="index_nav">
                        <div class="index_icon fl">
                                <img src="../images/icon_v1_40.png" alt="" class="index_icon_img fl" v-if="object.memberLevel==0">
                                <img src="../images/icon_v2_40.png" alt="" class="index_icon_img fl" v-else-if="object.memberLevel==1">
                                <img src="../images/icon_v3_40.png" alt="" class="index_icon_img fl" v-else-if="object.memberLevel==2">
                                <img src="../images/icon_v4_40.png" alt="" class="index_icon_img fl" v-else-if="object.memberLevel==3">
                                <img src="../images/icon_v_40.png" alt="" class="index_icon_img fl" v-else-if="object.memberLevel==null">
                                <span class="fl" v-if="object.memberLevel==null">普通用户</span>
                                <span class="fl" v-if="object.memberLevel!=null">会员</span>
                        </div>
                        <div class="person_use_money fl">
                            <p class="money_num">￥{{object.consumptionMoney}}</p>
                            <p class="money_data">当月消费金额</p>
                        </div>
                        <div class="index_tips fr">
                            <!-- <p class="vip_data">有效期至 2018-11-24</p> -->
                            <!-- <p class="vip_rule">等级规则</p> -->
                        </div>
                    </div>
                    <div class="index_detail">
                        <div class="index_tit">
                            <ul>
                                <li>等级</li>
                                <li>分红</li>
                                <li>上月消费金额</li>
                                <li>时间</li>
                            </ul>
                        </div>
                        <div class="detail_item">
                            <div class="clea_both" v-for="(item,inedx) in list">
                                <ul>
                                    <li>V{{item.memberLevel}}</li>
                                    <li class="detail_item_money">￥{{item.shareMoney}}</li>
                                    <li>￥{{item.consumptionMoney}}</li>
                                    <li>{{item.createTime}}</li>
                                </ul>
                            </div>
                        </div>
                        <div class="integral_page">
                            <el-pagination background layout="prev, pager, next" @current-change="handleCurrentChange"   :page-size='10' :total="total" class="page_list">
                            </el-pagination>
                        </div>
                    </div>
                </div>
            </div>


        </div>





       <div class="wrap clear_both">             <productfooter></productfooter>         </div>
    </div>
     
    <script src="../js/axios.js"></script>         <script src="../js/qs.js"></script>
    <script src="../js/swiper-4.3.5.min.js"></script>
    <script src="../js/browser.min.js"></script>
    <script src="../js/vue.js"></script>
    <script src="../js/element.js"></script>
    <script src="../js/main.js"></script>
    <script type="text/babel">
        var app = new Vue({
            el: '#app',
            data() {
                return {
                    address:4,
                    input10:'',
                    input11:'',
                    car_active:false,groups:3,
                    add_popup:false,
                    radio:'',
                    list:'',
                    total:1,
                    object:''
                };
            },
            created() {
                this.listUserUser()
                this.findMemberLevel()
            },
            mounted() {
                
            },
            methods: {
                handleCurrentChange(index){
                    console.log(index)
                },
                findMemberLevel(){
                    axios({
                        method:"POST",
                        url:base_url + "/logMoneys/findMemberLevel",
                        data:Qs.stringify({
                        }),
                        headers:{
                            'Content-Type':'application/x-www-form-urlencoded',
                            "TOKEN":localStorage.getItem('wACCESS_TOKEN')
                        }
                    })
                    .then(function (res) {
                        app.object = res.data.data.object
                        console.log(app.object)
                    })
                    .catch(function (error) {
                        console.log(error);
                    });
                    
                },
                listUserUser(){
                    axios({
                        method:"POST",
                        url:base_url + "/logMoneys/listUserUser",
                        data:Qs.stringify({
                        }),
                        headers:{
                            'Content-Type':'application/x-www-form-urlencoded',
                            "TOKEN":localStorage.getItem('wACCESS_TOKEN')
                        }
                    })
                    .then(function (res) {
                        app.list = res.data.data.list.list
                        // app.spuList = res.data.data.spuList.slice(0,8)
                    })
                    .catch(function (error) {
                        console.log(error);
                    });
                    
                },


                // 显示购物车               
                go_shop_car(){                     
                    window.location.href='../product/shop_car.html'  
                },
                car_box(){
                    this.car_active = !this.car_active
                },

                
                person_center(){
                    window.location.href='person_center.html?index='+0
                },
                person_order(){
                    window.location.href='person_order.html'
                },
                person_address(){
                    window.location.href='person_address.html'
                },
                person_exchange_page(){
                    window.location.href='person_exchange_page.html'
                },
                person_integral(){
                    window.location.href='person_integral_order.html'
                },
                person_collection(){
                    window.location.href='person_collection.html'
                },
                person_foot(){
                    window.location.href='person_footprint.html'
                },
                person_info(){
                    window.location.href='person_info.html'
                },
                person_message(){
                    window.location.href='person_message.html'
                },
                person_ticket(){
                    window.location.href='person_ticket.html'
                },
            }
        })
        
    </script>
</body>

</html>